﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="<?php echo __PUBLIC__?>/home/css/main.css"/>
    <link rel="stylesheet" type="text/css" href="<?php echo __PUBLIC__?>/home/css/jiziyuan_emoji.css"/>
    <script type="text/javascript" src="<?php echo __PUBLIC__?>/home/js/jquery-1.8.0.min.js"></script>
    <title>多种表情评论留言框 - 极资源</title>
</head>

<body>

<div class="header">
    <div class="header-body">
        <div class="logo">
            <a href="主页.html"><img src="<?php echo __PUBLIC__?>/home/pictures/logo.png"></a>
        </div>

        <?php


						if(!isset($_SESSION['uid']) || !$_SESSION['uid']){

				?>
        <!--未登录 start-->
        <div class="login_nav">
            <a href="/user/register">注册</a> |
            <a href="/user/login">登录</a>
        </div>
        <!--未登录 end-->
        <?php  }else{ ?>
        <!--已登录 start-->
        <div class="login_nav" style="">
            <a href="http://<?php echo __HOST__;?>/user/index"><?php echo $_SESSION['username']; ?></a> |
            <a href="http://<?php echo __HOST__; ?>/user/logout">退出</a>
        </div>
        <!--已登录 end-->

        <?php } ?>
    </div>
</div>


<div id="content" style="width: 700px; height: auto;margin: auto;">
    <form action="" method="post">
        <div class="wrap">
            <div class="comment">
                <div class="head-face">
                    <img src="<?php echo __PUBLIC__?>/home/pictures/1.jpg">
                    <p>我是鸟</p>
                </div>
                <div class="content">
                    <div class="cont-box">
                        <div id="content2" contenteditable="true">

                        </div>
                        <textarea class="text" name="contents" style="display:none"></textarea>
                    </div>
                    <div class="tools-box">
                        <div class="operator-box-btn"><span id="an" class="face-icon">☺</span><span
                                class="img-icon">▧</span></div>
                        <div class="submit-btn"><input type="submit" onClick="out();" value="提交评论"/></div>
                    </div>
                </div>
            </div>

            <!--评论内容 start-->

            <div id="info-show">
                <ul>
                    <?php foreach($comments as $k => $v){ ?>
                    <li>
                        <div class="head-face"><img src="<?php echo __PUBLIC__?>/home/pictures/1.jpg"></div>
                        <div class="reply-cont"><p class="username"><?php echo $v['username']; ?></p>
                            <p class="comment-body"><?php echo $v['contents'];?></p>
                            <p class="comment-footer">2016年10月5日　回复　点赞54　转发12</p></div>
                    </li>

                    <?php } ?>
                </ul>
            </div>
            <!--评论内容 end-->

            <!--分页 start-->
            <div style="float: left;margin-top: 30px;">
                <a class="pagination_page disabled">首页</a><a class="pagination_page disabled">上一页</a>
                <div class="pagination_page pagination_page_active">1</div>
                <a class="pagination_page" href="?page=2">2</a><a class="pagination_page" href="?page=3">3</a><a
                    class="pagination_page" href="?page=4">4</a><a class="pagination_page" href="?page=5">5</a><a
                    class="pagination_page" href="?page=6">6</a><a class="pagination_page" href="?page=7">7</a><a
                    class="pagination_page" href="?page=8">8</a><a class="pagination_page" href="?page=9">9</a><a
                    class="pagination_page" href="?page=2">下一页</a><a class="pagination_page pagination_right"
                                                                     href="?page=9">尾页</a>
            </div>
            <!--分页 end-->
        </div>
    </form>
</div>
</body>
<script type="text/javascript" src="<?php echo __PUBLIC__?>/home/js/main.js"></script>
<script type="text/javascript" src="<?php echo __PUBLIC__?>/home/js/jiziyuan_emoji.js"></script>
<script type="text/javascript">
    var config = ({
        EmojiID: 'an',      //点击显示EMOJI表情的按钮ID
        ContentID: 'content2' //留言内容框的ID,EMOJI表情将会插入到那里
    });
    Jiziyuan_Emoji(config);

    // 点击提交时，获得编辑的内容
    function out() {
        var html = $('#content2').html();
        $('.content textarea').val(html);
    }
</script>
</html>
